import java.awt.*;

public class Enemy {
    //定义图片
    Image image;
    //定义坐标
    int x;
    int y;
    //定义宽高
    int width;
    int height;
    //定义移动速度
    int speed;
    //定义方向
    int direction = 1;
    //定义敌方鱼的类型
    int type;
    //定义分值
    int count;
    //绘制自身方法
    public void paintSelf(Graphics g){
        g.drawImage(image,x,y,width,height,null);
    }
    //获取自身矩形用于碰撞检测
    public Rectangle getRec(){
        return new Rectangle(x,y,width,height);
    }
}

//敌方鱼左类
class Enemy_1_L extends Enemy{
    Enemy_1_L(){
        this.x = -45;
        this.y = (int)(Math.random()*700+100);
        this.width = 45;
        this.height = 69;
        this.speed = 10;
        this.type = 1;
        this.count = 1;
        this.image = GameUtils.enemyl_1img;
    }
}
//敌方鱼右类
class Enemy_1_R extends Enemy_1_L{
    Enemy_1_R(){
        this.x = 1400;
        direction = -1;
        this.image = GameUtils.enemyr_1img;
    }
}
//其他敌方鱼
class Enemy_2_L extends Enemy{
    Enemy_2_L(){
        this.x = -100;
        this.y = (int)(Math.random()*700+100);
        this.width = 100;
        this.height = 100;
        this.speed = 5;
        this.type = 2;
        this.count = 2;
        this.image = GameUtils.enemyl_2img;
    }
}
class Enemy_2_R extends Enemy_2_L{
    Enemy_2_R(){
        this.x = 1400;
        direction = -1;
        this.image = GameUtils.enemyr_2img;
    }
}
class Enemy_3_L extends Enemy{
    Enemy_3_L(){
        this.x = -300;
        this.y = (int)(Math.random()*700+100);
        this.width = 300;
        this.height = 150;
        this.speed = 15;
        this.type = 3;
        this.count = 3;
        this.image = GameUtils.enemyl_3img;
    }
    //修改第三种鱼的碰撞矩形
    public Rectangle getRec(){
        return new Rectangle(x+40,y+30,width-80,height-60);
    }
}
class Enemy_3_R extends Enemy_3_L{
    Enemy_3_R(){
        this.x = 1400;
        direction = -1;
        this.image = GameUtils.enemyr_3img;
    }
}

//boss鱼类
class Enemy_boss extends Enemy{
    Enemy_boss(){
        this.x=-1000;
        this.y=(int)(Math.random()*700+100);
        this.width=200;
        this.height=200;
        this.speed=80;
        this.count=0;
        this.type=10;
        this.image=GameUtils.bossimg;
    }
}